<template>
  <pageTabelLayout>
    <template #pageHeader>
      <div class="search-form divClass" v-if="headerShow" style="margin-top: 15px">
        <div>
          <a-form size="small" :model="pageData" layout="inline">
            <a-form-item label="机台号">
              <!-- <a-select popup-container="html"  class="bacClass" :style="{ width: '200px' }" :loading="loading4"
                                @search="handleSearch4" v-model="pageData.jitaihao" :filter-option="false"
                                allow-clear allow-search @focus="focusSel4">
                                <a-option v-for="item in pageData.jitaihaolist" :value="item.machineCode"> {{item.machineCode}}</a-option>
                            </a-select> -->
              <a-input
                allow-clear
                :style="{ width: '200px' }"
                class="bacClass"
                placeholder=""
                v-model="pageData.jitaihao"
                @press-enter="huiche"
              />
            </a-form-item>
            <a-form-item label="客户名称">
              <!-- <a-select popup-container="html"  class="bacClass" :style="{ width: '200px' }" :loading="loading3"
                                @search="handleSearch3" v-model="pageData.kehumingcheng" :filter-option="false"
                                allow-clear allow-search @focus="focusSel3">
                                <a-option v-for="item in pageData.kehumingchenglist" :value="item">{{ item }}</a-option>
                            </a-select> -->
              <a-input
                allow-clear
                :style="{ width: '200px' }"
                class="bacClass"
                placeholder=""
                v-model="pageData.kehumingcheng"
                @press-enter="huiche"
              />
            </a-form-item>
            <!-- <a-form-item label="日期">
              <a-date-picker
                popup-container="html"
                class="bacClass"
                v-model="pageData.jianyanriqi"
                :style="{ width: '200px' }"
                @press-enter="huiche"
              />
            </a-form-item> -->
          </a-form>
        </div>
        <div class="my-divisders">
          <Toolbar
            :items="pageData.btnList"
            @select="selectHandler"
            @export="exports"
            @exportAll="exportAll"
            @fhzy="fhzy"
          >
          </Toolbar>
        </div>
      </div>
      <div class="my-divisders">
        <a-divider orientation="center">
          <icon-double-up
            v-if="headerShow"
            @click="headerShow = false"
            :strokeWidth="2"
            :size="18"
          />
          <icon-double-down v-else @click="headerShow = true" :strokeWidth="2" :size="18" />
        </a-divider>
      </div>
      <!-- <div class="my-tool-bar">
                <Toolbar class="gesture" :items="pageData.btnList"  @select="selectHandler"
                    @export="exports"  @fhzy="fhzy">
                </Toolbar>
            </div> -->
    </template>
    <template #pageTabel>
      <!--
                        表格插件
                    -->
      <a-spin
        :loading="pageData.pageLoading"
        tip="加载中"
        dot
        style="height: 100%; width: 100%; z-index: 999"
      >
        <AgGridVuesCopys
          :rowHeight="33"
          :headerHeight="33"
          rowSelection="multiple"
          @grid-ready="gridReady"
          style="height: 100%"
          :defaultColDef="defaultColDef"
          :suppressCopyRowsToClipboard="true"
          class="ag-theme-alpine"
          :rowData="table.dataList"
          :columnDefs="tableColumns"
          :localeText="localeText1"
        >
        </AgGridVuesCopys>
      </a-spin>
    </template>
    <paginationCopys
      :page-size-options="pagingList1"
      :total="total"
      :page-size="size"
      :current="page"
      show-total
      show-jumper
      show-page-size
      @change="PageSize"
      @page-size-change="change1"
      style="justify-content: center"
    />
    <a-drawer
      style="z-index: 999"
      ok-text="保存"
      cancel-text="关闭"
      :drawer-style="{ zIndex: 9999 }"
      :mask-closable="false"
      :width="400"
      :ok-loading="pageData.pageLoading"
      :visible="pageData.showAdd"
      unmountOnClose
      @ok="sideOk"
      @cancel="pageData.showAdd = false"
    >
      <template #title>
        {{ pageData.sideTitle }}
      </template>
      <div>
        <a-form ref="formRef" layout="horizontal" :model="dataForm">
          <a-form-item
            label-col-flex="80px"
            label="编号"
            field="brandCode"
            :rules="[{ validator: isChiese }, { required: true, message: '编号必填' }]"
            :validate-trigger="['change', 'blur']"
          >
            <a-input
              class="bacClass"
              placeholder=""
              v-model="dataForm.brandCode"
              @blur="inputBlur"
            />
          </a-form-item>
          <a-form-item
            label-col-flex="80px"
            label="品牌名称"
            field="brandName"
            :rules="[{ required: true, message: '品牌名称必填' }]"
            :validate-trigger="['change', 'blur']"
          >
            <a-input class="bacClass" placeholder="" v-model="dataForm.brandName" />
          </a-form-item>
          <a-form-item
            label-col-flex="80px"
            label="布类类型"
            field="clothClass"
            :rules="[{ required: true, message: '布类类型必填' }]"
            :validate-trigger="['change', 'blur']"
          >
            <a-select
              popup-container="html"
              class="bacClass"
              :loading="loading"
              placeholder=""
              @search="handleSearch1"
              v-model="dataForm.clothClass"
              :filter-option="false"
              allow-search
              allow-clear
              @focus="focusSel1"
            >
              <a-option v-for="item in pageData.typeList" :value="item">{{ item }}</a-option>
            </a-select>
          </a-form-item>
          <a-form-item label-col-flex="80px" label="备注" field="remark">
            <!-- <a-input v-model="dataForm.remark" /> -->
            <a-textarea
              class="bacClass"
              v-model="dataForm.remark"
              :max-length="400"
              allow-clear
              show-word-limit
            />
          </a-form-item>
        </a-form>
      </div>
    </a-drawer>
  </pageTabelLayout>
</template>

<script lang="ts">
  import { post } from '@/api/http'
  import {
    useTable,
    useRowKey,
    useTableColumn,
    usePagination,
    useRowSelection,
  } from '@/hooks/table'
  import emitter from '@/hooks/useEventBus'
  import { ref, reactive, onMounted, toRefs } from 'vue'
  import Toolbar from '@/components/Toolbar.vue'
  import { Button, Form, Message, Modal } from '@arco-design/web-vue'
  import { FormInstance } from '@arco-design/web-vue/es/form'
  import { baseURL } from '../../api/axios.config'
  import axios from 'axios'
  import filedownload from 'js-file-download'
  import usePermission from '@/store/modules/permission'
  import PageTabelLayout from '@/components/pageTabelLayout.vue'
  import MyTable from '@/components/MyTable'
  import ButtonRenderer from '@/components/TableCellRenderer/ButtonRenderer'
  import { template } from 'lodash'
  import { setupGlobalComponent } from '@/layouts'
  import { localeText } from '@/api/aggridZw'
  import { pagingList } from '@/api/paging'
  // 引入
  
  import dayjs from 'dayjs'
  interface BrandInfo {
    id: any
    brandCode: string
    brandName: string
    clothClass: string
    remark: string
    deleteState: number | string
    createName: string
    createTime: string
    updateName: string
    updateTime: string
  }

  export default {
    name: 'MachineCondition',

    setup(props: any, { emit }) {
      const total = ref(0)
      const page = ref(1)
      const size = ref(10)
      function PageSize(val: any) {
        page.value = val
        doRefresh()
      }
      function change1(val: any) {
        size.value = val
        doRefresh()
      }
      const headerShow = ref<boolean>(true)

      function doRefresh() {
        var dangtianpishu = 0
        var dangtianchanlinag = 0
        var obj = { page: page.value, size: size.value, customName: '', machineCode: '' }
        if (pageData.kehumingcheng != '') {
          obj['customName'] = pageData.kehumingcheng
          obj['page'] = 1
        }
        if (pageData.jitaihao != '') {
          obj['machineCode'] = pageData.jitaihao
          obj['page'] = 1
        }
        pageData.pageLoading = true
        post({
          url: 'product/statement/getMachineDetail',
          data: obj,
        })
          .then(({ data, code }: any) => {
            sessionStorage.setItem('wsnm', JSON.stringify(data.list))
            if (code === 200) {
              // 查询方法改
              gridOption.value.setFilterModel(null)
              gridOption.value.setRowData(data.list)
              total.value = data.total
              data.list.map((o: any) => {
                dangtianpishu = dangtianpishu + Number(o.horseNum)
                dangtianchanlinag = dangtianchanlinag + Number(o.nowWeight)
              })
            }
          })
          .catch(console.log)
          .finally(() => {
            pageData.pageLoading = false
          })
      }

      const { selectedRowKeys, onSelectionChange } = useRowSelection()
      const pagination = usePagination(doRefresh)
      const table = useTable()
      const rowKey = useRowKey('id')
      const tableColumns = [
        {
          showRowGroup: 'hide_def',
          headerName: '',
          checkboxSelection: true,
          headerCheckboxSelection: true,
          pinned: 'left',
          width: 50,
          resizable: false,
          filter: false,
          sortable: false,
          minWidth: 50,
          maxWidth: 50,
          lockPosition: 'left',
        },
        {
          headerName: '公司',
          field: 'firm',
          width: 150,
        },
        {
          headerName: '位置号',
          field: 'coordinate',
          width: 150,
        },
        {
          headerName: '生产单号',
          field: 'weavingCode',
          width: 150,
        },
        {
          headerName: '坯布编号',
          field: 'greyCode',
          width: 150,
        },
        {
          headerName: '坯布名称',
          field: 'greyName',
          width: 150,
        },
        {
          headerName: '机台号',
          field: 'machineCode',
          width: 150,
        },
        {
          headerName: '织单机型',
          field: 'orderMachineType',
          width: 150,
        },
        {
          headerName: '织单针寸数',
          field: 'workDrum',
          width: 150,
        },
        {
          headerName: '纱长',
          field: 'yarnLength',
          width: 150,
        },
        {
          headerName: '原料信息',
          field: 'rawInfo',
          width: 150,
        },
        {
          headerName: '颜色',
          field: 'colorName',
          width: 150,
        },
        // {
        //   headerName: '色号',
        //   field: 'colorCodes',
        //   width: 150,
        // },
        {
          headerName: '客户名称',
          field: 'customName',
          width: 150,
        },
        {
          headerName: '机台针寸数',
          field: 'machineWorkDrum',
          width: 150,
        },
        {
          headerName: '机台状态',
          field: 'machineState',
          width: 150,
        },
        {
          headerName: '主推商品号',
          field: 'productColthCode',
          width: 150,
        },
        {
          headerName: '设备机型',
          field: 'machineTypeName',
          width: 150,
        },
        {
          headerName: '机台预计完成时间',
          field: 'finishTime',
          width: 150,
        },
        {
          headerName: '机台负荷',
          field: 'machineInfo',
          width: 150,
           valueGetter: (params: any) => {
            return params.data.machineInfo == 0 ? '空闲'
            : params.data.machineInfo == 1 ? '正常'
            : params.data.machineInfo == 2 ? '饱和'
            : params.data.machineInfo == 3 ? '负荷'
            : params.data.machineInfo == 4 ? '待单'
            : ''
          },
        },
      ]
      const pageData = reactive<{
        showAdd: boolean
        sideTitle: string
        dropDownData: any
        nameList: []
        pageLoading: boolean
        typeList: []
        dropDownData1: any
        rHeight: any
        btnList: any[]
        isEdit: boolean
        hejishuzu: []
        jitaihao: any
        jitaihaolist: []
        kehumingcheng: any
        kehumingchenglist: any[]
        jianyanriqi: any
      }>({
        nameList: [],
        showAdd: false,
        sideTitle: '新增品牌资料',
        dropDownData: '',
        pageLoading: false,
        typeList: [],
        dropDownData1: '',
        rHeight: 0,
        btnList: [],
        isEdit: false,
        hejishuzu: [],
        jitaihao: '',
        jitaihaolist: [],
        kehumingcheng: '',
        kehumingchenglist: [] as any,
        jianyanriqi: '',
      })

      interface gcType {
        id: any
        company: any
      }

      //下拉框得到焦点
      const focusSel = () => {
        selCxAll({ brandName: '', deleteState: 0 })
      }
      //下拉数据
      const options = ref<any>(pageData.nameList)
      const loading = ref(false)
      const handleSearch = (value: any) => {
        if (value) {
          const ob = { brandName: value, deleteState: 0 }
          loading.value = true
          selCxAll(ob)
          options.value = pageData.nameList
          loading.value = false
        } else {
          options.value = []
        }
      }

      //下拉框查询
      function selCxAll(val: any) {
        post({
          url: 'product/Brand/getFieldValue',
          data: val,
        }).then(({ data, code }: any) => {
          if (code === 200) {
            let dataList: any = []
            data.forEach(function (o: any) {
              dataList.push(o['brandName'])
            })
            pageData.nameList = dataList
          } else {
            Message.error({
              content: '查询失败！',
              duration: 5000,
            })
          }
        })
      }

      onMounted(() => {
        // 切换tap到本页面执行的方法
        emitter.on('BrandInfo', () => {
          // selCxAll1({});
          doRefresh()
        })
      })
      let cxbl = ''
      //查询
      const selectHandler = () => {
        pagination.page = 1
        cxbl = pageData.dropDownData
        doRefresh()
      }
      const queryData = reactive({
        clothType: '',
      })
      const addHandler = () => {
        selCxAll1({ clothClass: '' })
        for (var key in dataForm) {
          if (key === 'id') {
            dataForm[key] = null
          } else {
            dataForm[key] = ''
          }
        }

        pageData.showAdd = true
        pageData.sideTitle = '新增品牌资料'
      }
      const dataForm = reactive<BrandInfo>({
        id: null,
        remark: '',
        brandName: '',
        clothClass: '',
        deleteState: '',
        createName: '',
        createTime: '',
        updateName: '',
        updateTime: '',
        brandCode: '',
      })

      // 表格准备事件
      const gridOption = ref()
      const gridReady = (params: any) => {
        gridOption.value = params.api
      }

      let formRef = ref<FormInstance>()
      const sideOk = () => {
        formRef.value?.validate().then((err) => {
          if (!err) {
            formRef.value?.validate().then((err) => {
              if (!err) {
                pageData.pageLoading = true
                if (pageData.sideTitle === '新增品牌资料') {
                  post({
                    url: 'product/Brand/insert',
                    data: [dataForm],
                  })
                    .then((res: any) => {
                      if (res.code === 200) {
                        formRef.value?.resetFields()
                        pageData.showAdd = false

                        Message.success({
                          content: '新增成功',
                          duration: 5000,
                        })
                      } else {
                        Message.error({
                          content: res.message,
                          duration: 5000,
                        })
                      }
                      doRefresh()
                    })
                    .finally(() => {
                      doRefresh()
                      pageData.pageLoading = false
                    })
                } else {
                  post({
                    url: 'product/Brand/update',
                    data: [dataForm],
                  })
                    .then((res: any) => {
                      if (res.code === 200) {
                        formRef.value?.resetFields()
                        pageData.showAdd = false
                        Message.success({
                          content: '修改成功',
                          duration: 5000,
                        })
                      } else {
                        Message.error({
                          content: res.message,
                          duration: 5000,
                        })
                      }
                    })
                    .finally(() => {
                      doRefresh()
                      pageData.pageLoading = false
                    })
                }
              }
            })
          }
        })
      }
      const deleteHandler = () => {
        if (gridOption.value.getSelectedRows().length === 0) {
          Message.error('请先勾选')
          return
        }

        Modal.confirm({
          title: '系统提示',
          content: '确认删除选中的数据?',
          onOk() {
            pageData.pageLoading = true
            post({
              url: 'product/Brand/deleteList',
              data: gridOption.value.getSelectedRows().map((o: any) => {
                return o.id
              }),
            })
              .then(({ code, data }: any) => {
                if (code === 200) {
                  Message.success({
                    content: '删除成功',
                    duration: 5000,
                  })
                  pagination.page = 1
                  doRefresh()
                } else {
                  Message.error({
                    content: '删除失败',
                    duration: 5000,
                  })
                }
              })
              .finally(() => {
                pageData.pageLoading = false
              })
          },
        })
      }

      let curobj = null
      const editHandler = (record: BrandInfo) => {
        curobj = record
        selCxAll1({ key: '' })
        dataForm.brandCode = record.brandCode
        dataForm.brandName = record.brandName
        dataForm.clothClass = record.clothClass
        dataForm.remark = record.remark
        dataForm.id = record.id
        pageData.sideTitle = '修改品牌资料'
        pageData.showAdd = true
      }
      //判断是否填写了中文
      const isChiese = (value: string, cb: Function) => {
        return new Promise<void>((resolve) => {
          if (window.encodeURI(value).indexOf('%') !== -1) {
            cb('填写的值不能包含中文！')
          }
          resolve()
        })
      }
      //input离开焦点 将小写转大写
      const inputBlur = () => {
        dataForm.brandCode = dataForm.brandCode.toUpperCase()
      }
      //导出
      const exports = () => {
        var zongshuzu = [] as any
        gridOption.value.getSelectedRows().forEach(function (o: any) {
          zongshuzu.push(o)
        })
        localStorage.setItem('daocu', JSON.stringify(zongshuzu))
        if (gridOption.value.getSelectedRows().length === 0) {
          Message.error('请先勾选')
          return
        } else {
          let idList: any = []
          // gridOption.value.getSelectedRows().forEach(function(o:any){
          //     idList.push(o['id'])
          // })
          zongshuzu.forEach(function (o: any) {
            idList.push(o['id'])
          })
          //将表头拼接出来
          let head =
            '<th>公司</th><th>生产单号</th><th>坯布编号</th><th>坯布名称</th><th>机台编号</th><th>织单机型</th><th>织单针寸数</th><th>纱长</th><th>颜色</th><th>色号</th><th>客户名称</th><th>机台针寸数</th><th>机台状态</th><th>主推商品号</th>'
          //拿到当前表格数据与勾选的行做筛选
          // let nowRow = table.dataList.filter(function (o) {
          //     return (gridOption.value.getSelectedRows().map((o: any) => { return o.id })).indexOf(o["id"]) !== -1;
          // })
          let nowRow = gridOption.value.getSelectedRows()
          let body = ''
          var dtpishu = 0
          var dtchangliang = 0
          nowRow.forEach(function (o: any, index: any) {
            dtpishu = dtpishu + o['horseNum']
            dtchangliang = dtchangliang + o['nowWeight']
            o['horseNum'] = dtpishu
            o['nowWeight'] = dtchangliang
            body += '<tr><td>' + o['firm'] + '</td>'
            body += '<td>' + o['weavingCode'] + '</td>'
            body += '<td>' + o['greyCode'] + '</td>'
            body += '<td>' + o['greyName'] + '</td>'
            body += '<td>' + o['machineCode'] + '</td>'
            body += '<td>' + o['orderMachineType'] + '</td>'
            body += '<td>' + o['workDrum'] + '</td>'
            body += '<td>' + o['yarnLength'] + '</td>'
            body += '<td>' + o['colorName'] + '</td>'
            body += '<td>' + o['colorCodes'] + '</td>'
            body += '<td>' + o['customName'] + '</td>'
            body += '<td>' + o['machineWorkDrum'] + '</td>'
            body += '<td>' + o['machineState'] + '</td>'
            body += '<td>' + o['productColthCode'] + '</td>'
            body += '</tr>'
          })
          tableToXlsx(head, '机台动态表', body)
          console.log(table)
        }
      }
      const exportAll = () => {
        var obj = {}
        if (pageData.kehumingcheng != '') {
          obj['customName'] = pageData.kehumingcheng
        }
        if (pageData.jitaihao != '') {
          obj['machineCode'] = pageData.jitaihao
        }
        post({
          url: '/product/statement/exportGetMachineDetail',
          data: obj,
          responseType: 'blob',
        }).then((res: any) => {
          filedownload(res, '机台动态表.xlsx')
        })
      }
      function tableToXlsx(head: any, filename: any, body: any) {
        const uri = 'data:application/vnd.ms-excel;base64,',
          template = `<html>
            <head><meta charset="UTF-8"></head>
            <body><table border="1"><tr>${head}</tr>${body}</table></body>
        </html>`

        const a = document.createElement('a')
        a.href = uri + window.btoa(unescape(encodeURIComponent(template)))
        a.download = filename
        a.click()
        document.removeChild(a)
      }

      //模板下载
      const downloadHandler = () => {
        axios
          .get(baseURL + '/product/Brand/uploadModel', {
            responseType: 'blob',
            headers: {
              token: sessionStorage.getItem('USER-TOKEN-KEY'),
            },
          })
          .then((res) => {
            if (res.status === 200) {
              filedownload(res.data, '品牌资料.xlsx')
            }
          })
      }
      //导入
      const importHandler = () => {
        const inputEle: HTMLInputElement = document.createElement('input')
        inputEle.type = 'file'
        inputEle.id = 'fileUploadExcel'
        inputEle.accept =
          'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel'
        inputEle.addEventListener('change', (e) => {
          const formData = new FormData()
          if (inputEle.files !== null) {
            formData.append('file', inputEle.files[0] || '')
          } else {
            Message.warning('未选择文件！')
            return
          }
          pageData.pageLoading = true
          axios
            .post(baseURL + '/product/Brand/importModelData', formData, {
              headers: {
                'Content-Type': 'multipart/form-data',
                token: sessionStorage.getItem('USER-TOKEN-KEY'),
              },
            })
            .then((result) => {
              if (result.data['code'] === 200) {
                Message.success('导入成功')
              } else {
                Message.error(result.data.message)
              }
            })
            .finally(() => {
              pageData.pageLoading = false
              doRefresh()
            })
        })
        inputEle.click()
      }
      //下拉数据
      const options1 = ref<any>(pageData.typeList)
      const loading1 = ref(false)
      const handleSearch1 = (value: any) => {
        if (value) {
          const ob = {
            key: value,
            deleteState: 0,
          }
          loading.value = true
          selCxAll1(ob)
          options.value = pageData.typeList
          loading.value = false
        } else {
          options.value = []
        }
      }

      //下拉框查询 布料类型
      function selCxAll1(val: any) {
        post({
          url: 'product/mercery/getAllMerceryName',
          data: val,
        }).then(({ data, code }: any) => {
          if (code === 200) {
            pageData.typeList = data
          } else {
            Message.error({
              content: '查询失败！',
              duration: 5000,
            })
          }
        })
      }

      const options3 = ref<any>(pageData.kehumingchenglist)
      const loading3 = ref(false)
      const handleSearch3 = (value: any) => {
        if (value) {
          const ob = { customName: value }
          loading.value = true

          selCxAll3(ob)
          options.value = pageData.kehumingchenglist
          loading.value = false
        } else {
          options.value = []
        }
      }
      function selCxAll3(val: any) {
        post({
          url: 'planSingle/planOrder/getDropInfo',
          data: val,
        }).then(({ data, code }: any) => {
          if (code === 200) {
            // (data as string[]).splice(0, 0, "全部");
            //sessionStorage.setItem("kehumingccheng",JSON.stringify(data))
            //sessionStorage.setItem("iskehupp",JSON.stringify(data))

            pageData.kehumingchenglist = data
          } else {
            Message.error({
              content: '查询失败！',
              duration: 5000,
            })
          }
        })
      }

      const options4 = ref<any>(pageData.jitaihaolist)
      const loading4 = ref(false)
      const handleSearch4 = (value: any) => {
        if (value) {
          const ob = { machineCode: value }
          loading.value = true

          selCxAll4(ob)
          options.value = pageData.jitaihaolist
          loading.value = false
        } else {
          options.value = []
        }
      }
      //下拉框查询 坯布名称
      function selCxAll4(val: any) {
        post({
          url: 'planSingle/machine/getFieldValue',
          data: val,
        }).then(({ data, code }: any) => {
          if (code === 200) {
            // (data as string[]).splice(0, 0, "全部");

            pageData.jitaihaolist = data
            //sessionStorage.setItem("kehumingccheng",JSON.stringify(pageData.jitaihao))
          } else {
            Message.error({
              content: '查询失败！',
              duration: 5000,
            })
          }
        })
      }

      //下拉框得到焦点
      const focusSel1 = () => {
        selCxAll1({ key: '' })
      }
      const focusSel4 = () => {
        selCxAll4({ machineCode: '' })
      }
      const focusSel3 = () => {
        selCxAll3({ customName: '' })
      }
      //设置权限
      // ['查询', '新增', '删除', '导出', '导入']
      const permissionStore = usePermission()

      // if (permissionStore.hasPermisson('ppzl.cx')) {
      // }
      pageData.btnList.push('查询')

      pageData.btnList.push('导出')
      pageData.btnList.push('全部导出')
     
      // if (permissionStore.hasPermisson('ppzl.dr')) {
      //   pageData.btnList.push('返回主页')
      // }
      if (permissionStore.hasPermisson('ppzl.xg')) {
        pageData.isEdit = true
      }
      const handleChange = (_data: any) => {
        table.handleSuccess(_data)
      }
      const fhzy = () => {
        emit('takebiaoji', 0)
        //localStorage.setItem('vvvv',props.biaoji)
      }
      const defaultColDef = {
        sortable: true,
        resizable: true,
        filter: true,
        // flex: 1
      }
      const localeText1: any = ref(localeText)
      const huiche = () => {
        doRefresh()
      }
      const pagingList1: any = ref(pagingList)
      return {
        pagingList1,
        huiche,
        localeText1,
        defaultColDef,
        total,
        PageSize,
        change1,
        page,
        size,
        editHandler,
        deleteHandler,
        sideOk,
        formRef,
        dataForm,
        addHandler,
        selectedRowKeys,
        pagination,
        tableColumns,
        table,
        rowKey,
        pageData,
        queryData,
        selectHandler,
        isChiese,
        inputBlur,
        exports,
        exportAll,
        options,
        options3,
        options4,
        loading,
        loading4,
        loading3,
        handleSearch,
        handleSearch4,
        focusSel,
        downloadHandler,
        importHandler,
        options1,
        loading1,
        handleSearch1,
        handleSearch3,
        focusSel1,
        focusSel3,
        focusSel4,
        headerShow,
        handleChange,
        gridReady,
        fhzy,
      }
    },
    props: {
      biaoji: Number,
    },

    components: { Toolbar, PageTabelLayout,  },
  }
</script>
<style scoped>
  :deep(.ag-cell-value) {
    user-select: initial;
    -moz-user-select: text;
    -ms-user-select: text;
    -webkit-user-select: text;
  }

  :deep(.ag-cell) {
    border-right: 1px solid #dde2eb;
  }

  :deep(.ag-header-cell) {
    border-right: 1px solid #dde2eb;
  }
</style>
